import httpInstance from "@/utils/http";

export function getCategoryAPI(id){
  return httpInstance({
    url: '/category',
    params: {
      id
    }
  })

}

export const getCategoryFilterAPI = (id)=>{
  return httpInstance({
    url: '/category/sub/filter',
    params: {
      id
    }
  })
}

export const getSubCategoryAPI = (data)=>{
  return httpInstance({
    url: '/category/goods/temporary',
    method: 'POST',
    data
  })
}

//获取详情页数据
export const getDetailAPI = (id)=>{
  return httpInstance({
    url: '/goods',
    params: {
      id
    }
  })
}

//获取详情页热榜信息
export const getHotGoodsAPI = ({ id,type,limit=3 })=>{
  return httpInstance({
    url: '/goods/hot',
    params: {
      id,
      type,
      limit
    }
  })
}


